<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use SwooleTW\Http\Websocket\Facades\Websocket;

class NotifyWebsocket extends Controller
{
    protected  $websocket;
    public function __construct(Websocket $websocket)
    {
        $this->websocket=$websocket;
    }

    public function onMessage()
    {
        $this->websocket->emit('message', 'hello world');
    }
}
